package com.donleo.ssm.model;

import com.fasterxml.jackson.annotation.JsonFormat;

import java.io.Serializable;
import java.util.Date;

/**
 * @author liangd
 * date 2020-11-22 21:10
 * code 基础类
 */
public class BaseModel implements Serializable {
    /**
     * 当前页
     */
    private Integer pageNum;
    /**
     * 一页显示几条
     */
    private Integer pageSize;
    /**
     * 数据是否可用
     */
    private String dataEnable;
    /**
     * 创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;
    /**
     * 更新时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date updateTime;
    /**
     * 排序号
     */
    private Integer sequence;
    /**
     * 版本号
     */
    private String version;

    public Integer getPageNum() {
        return pageNum;
    }

    public void setPageNum(Integer pageNum) {
        this.pageNum = pageNum;
    }

    public Integer getPageSize() {
        return pageSize;
    }

    public void setPageSize(Integer pageSize) {
        this.pageSize = pageSize;
    }

    public String getDataEnable() {
        return dataEnable;
    }

    public void setDataEnable(String dataEnable) {
        this.dataEnable = dataEnable;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    public Integer getSequence() {
        return sequence;
    }

    public void setSequence(Integer sequence) {
        this.sequence = sequence;
    }

    public String getVersion() {
        return version;
    }

    public void setVersion(String version) {
        this.version = version;
    }

    /**************** 是否启用******************/
    private String dataEnableStr;

    public String getDataEnableStr() {
        if ("yes".equals(dataEnable)){
            dataEnableStr="启用";
        }
        if ("no".equals(dataEnable)){
            dataEnableStr="禁用";
        }
        return dataEnableStr;
    }

    public void setDataEnableStr(String dataEnableStr) {
        this.dataEnableStr = dataEnableStr;
    }
}
